package com.tp3.nutribar;


import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

public class Dashboard extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_dashboard);
        ImageView dashboard  = (ImageView)findViewById(R.id.dashboard);
        
        String dashboardStatus = DashboardStatus.dashboardStatus;
        if (dashboardStatus == "@drawable/dashboard_initial_transparent")
        {
        	dashboard.setImageResource(R.drawable.dashboard_initial_transparent);
        }
        else
        {
        	dashboard.setImageResource(R.drawable.dashboard_after_one_slice_transparent);
        }

        
        final Button button_stats = (Button) findViewById(R.id.statistiques_bouton);
        button_stats.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            	Intent myIntent = new Intent(Dashboard.this, Statistiques.class);
            	Dashboard.this.startActivity(myIntent);
            }
        });
        
        final Button button_profil = (Button) findViewById(R.id.profil_sante_bouton);
        button_profil.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            	Intent myIntent = new Intent(Dashboard.this, ActProfilSante.class);
            	Dashboard.this.startActivity(myIntent);
            }
        });
    
        final Button button_ajouter_repas = (Button) findViewById(R.id.ajouter_repas_bouton);
        button_ajouter_repas.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            	Intent myIntent = new Intent(Dashboard.this, AjouterRepasPart1.class);
            	Dashboard.this.startActivity(myIntent);
            }
        });
    
    
    
    
    
    
    
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_dashboard, menu);
        return true;
    }
}
